package com.leapp.sk.ui.activity.task

import android.os.Bundle
import android.support.v4.app.Fragment
import com.example.mvp.activity.BaseActivityMVP
import com.example.mvp.binder.BaseDataBinder
import com.leapp.sk.R
import com.leapp.sk.bean.TopLayoutTitleEntity
import com.leapp.sk.binder.BaseBinder
import com.leapp.sk.ui.fragment.task.AllParentingTaskFragment
import com.leapp.sk.ui.fragment.task.MyParentingTaskFragment
import com.leapp.sk.viewdelegate.task.TeacherParentTaskDelegate

/**
 * 老师端亲子作业
 * @author  chaohaipeng  on 2018/8/10.
 */
class TeacherParentTaskActivity :BaseActivityMVP<TeacherParentTaskDelegate>(){

    /**
     * fragment数据集合
     */
    private var fragmentLists = mutableListOf<Fragment>()
    /**
     * 标签集合
     */
    private var titles = mutableListOf<TopLayoutTitleEntity>()
    override fun initDate() {
        fragmentLists.add(AllParentingTaskFragment())
        fragmentLists.add(MyParentingTaskFragment())
        val topULayoutTitleEntity = TopLayoutTitleEntity()
        topULayoutTitleEntity.title = resources.getString(R.string.string_task_all)
        val topRLayoutTitleEntity = TopLayoutTitleEntity()
        topRLayoutTitleEntity.title = resources.getString(R.string.string_task_my)
        titles.add(topULayoutTitleEntity)
        titles.add(topRLayoutTitleEntity)
        viewDelegate.initTabLayout(this,fragmentLists,titles)
    }

    override fun bindEvenListener() {
    }

    override fun getDelegateClass(): Class<TeacherParentTaskDelegate> {
        return TeacherParentTaskDelegate::class.java
    }

    override fun getDataBinder(): BaseDataBinder<*, *> {
    return BaseBinder()
    }

    override fun initView(p0: Bundle?) {
        viewDelegate.setTitle(resources.getString(R.string.string_task_parenting))
    }
}